package com.ysccc.shares.web.vo;

import java.io.Serializable;
import java.util.List;
import java.util.stream.Collectors;

import com.ysccc.shares.entity.SharesSaleAlert;
import com.ysccc.tools.Dates;
import com.ysccc.tools.Emptys;

import lombok.Data;

@Data
public class SharesSaleAlertVo implements Serializable {

	private static final long serialVersionUID = 1L;
	
	private Long id;

	/** 报警提醒的日期 */
	private String day;
	
	/** 状态，true：报警，false：关闭 */
	private Boolean status;

	private List<SharesVo> shareses;

	public SharesSaleAlertVo(SharesSaleAlert alert) {
		super();
		this.id = alert.getId();
		this.day = Dates.format(alert.getDay());
		this.status = alert.getStatus();
		if (Emptys.isNotEmpty(alert.getShareses())) {
			this.shareses = alert.getShareses().stream().map(SharesVo::new).collect(Collectors.toList());
		}
	}



	public SharesSaleAlertVo() {
		super();
	}
}
